From: Ian Jackson Date: Wed, 28 May 2014 16:06:21 +0000 (+0100) Subject: libxc: rump kernels: Use standard xc_osdep_get_info X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4662 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=79b4ef15ee1088161c4d4e7471abd22527c4108c;p=xen.git libxc: rump kernels: Use standard xc_osdep_get_info Do not try to support the dlopen-based xc indirection. Introduce a local #define DO_DYNAMIC_OSDEP to centralise the condition. Add comments to the #endifs. Signed-off-by: Ian Jackson Acked-by: Ian Campbell --- v2: Remove duplication by introducing DO_DYNAMIC_OSDEP. Add comments to the #endifs. --- diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index a3da614181..1c214ddc8f 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -33,6 +33,10 @@ #define XENCTRL_OSDEP "XENCTRL_OSDEP" +#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__) +#define DO_DYNAMIC_OSDEP +#endif + /* * Returns a (shallow) copy of the xc_osdep_info_t for the * active OS interface. @@ -50,7 +54,7 @@ static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info) { int rc = -1; -#ifndef __MINIOS__ +#ifdef DO_DYNAMIC_OSDEP const char *lib = getenv(XENCTRL_OSDEP); xc_osdep_info_t *pinfo; void *dl_handle = NULL; @@ -86,7 +90,7 @@ static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info) info->dl_handle = dl_handle; } else -#endif +#endif /*DO_DYNAMIC_OSDEP*/ { *info = xc_osdep_info; info->dl_handle = NULL; @@ -94,21 +98,21 @@ static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info) rc = 0; -#ifndef __MINIOS__ +#ifdef DO_DYNAMIC_OSDEP out: if ( dl_handle && rc == -1 ) dlclose(dl_handle); -#endif +#endif /*DO_DYNAMIC_OSDEP*/ return rc; } static void xc_osdep_put(xc_osdep_info_t *info) { -#ifndef __MINIOS__ +#ifdef DO_DYNAMIC_OSDEP if ( info->dl_handle ) dlclose(info->dl_handle); -#endif +#endif /*DO_DYNAMIC_OSDEP*/ } static const char *xc_osdep_type_name(enum xc_osdep_type type)